feat(react-charts): vega lite schema support#35546
Merged
AtishayMsft merged 72 commits intomicrosoft:masterfrom Mar 2, 2026
Merged
feat(react-charts): vega lite schema support#35546AtishayMsft merged 72 commits intomicrosoft:masterfrom
AtishayMsft merged 72 commits intomicrosoft:masterfrom
Conversation
📊 Bundle size report✅ No changes found |
|
Pull request demo site: URL |
- Use resetIdsForTests() from @fluentui/react-utilities (same as Plotly tests) - Update snapshots with deterministic IDs - Update schema count test from >100 to 25 (after schema reduction) - All VegaDeclarativeChart tests now pass Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add Playwright e2e spec for batch screenshot testing of vega schemas - Add unit test spec for VegaDeclarativeChart storybook stories - Add timeout test spec for debugging blank/error schemas - Add Playwright config and helper scripts (e2e runner, contact sheets) - Add code review observations and reported bugs documentation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove overflow:hidden from grid container and cells so legends are not clipped. minWidth:0 already prevents grid blowout. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Hide legends on all sub-charts and render a single shared legend below the grid using getVegaLiteLegendsProps + Legends component. Fixes legend being clipped inside grid cells. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Pass multiSelectLegendProps (canSelectMultipleLegends, onChange, selectedLegends) to the shared Legends component so clicking a legend item propagates the selection state to all sub-charts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Verifies that hconcat donut charts render a shared legend outside the grid with correct legend items. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Revert DeclarativeChart.tsx and ChartTable.tsx to master (keep DeclarativeChartHooks.ts as shared utility) - Remove color-schemes and validation-tests example folders - Remove CODE_REVIEW_OBSERVATIONS.md and ReportedBugs.csv - Remove E2E_SCREENSHOT_TESTING.md, playwright.config.ts - Remove stories/scripts/ (e2e.js, create-contact-sheets.mjs) - Remove e2e spec, unit spec, and timeout-test spec files These helper scripts and docs will be moved to the fluentui-charting-contrib repository. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rename to VegaDeclarativeChartHooks.ts and update import. Keeps DeclarativeChart folder clean of Vega-specific files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add !! to isHConcatSpec/isVConcatSpec for boolean coercion - Add non-null assertions for spec.hconcat/vconcat after guard - Cast ChartRenderer props to any (transformer output is dynamic) - Remove unused yType variable - Fix rectText possibly undefined with fallback - Cast color.sort access to Record for missing property - Cast arc mark comparison to string for type overlap - Add datum, timeUnit, zero, reverse to type interfaces Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Restore Schema.plotlySchema to non-optional (matches reverted DeclarativeChart.tsx) and remove selectedLegends. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add VegaDeclarativeChart to index.ts barrel export and restore VegaDeclarativeChart, VegaDeclarativeChartProps, VegaLiteSpec, VegaSchema entries in react-charts.api.md. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The tsconfig.spec.json strict mode requires explicit types for spec objects passed to VegaDeclarativeChart to avoid mark type mismatch. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ain type - Add 'arc' to VegaLiteMark union type - Add xOffset encoding for grouped bar chart detection - Add tooltip encoding (any type for flexibility) - Change scale.domain from tuple to array for variable-length domains Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add non-null assertions for spec.encoding, result.data, and props.data accesses in test assertions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previous Behavior
New Behavior
Summary
Adds a new
VegaDeclarativeChartcomponent that renders Vega-Lite specifications using Fluent UI chart components. This is a companion to the existing Plotly-basedDeclarativeChart, enabling a second declarative grammar for data visualization.The component transforms Vega-Lite JSON specs into the appropriate Fluent UI chart type (line, bar, area, scatter, donut, heatmap, polar, etc.) and renders them with full interactivity including legends, tooltips, and theme support.
New Files
VegaDeclarativeChart.tsxVegaLiteSchemaAdapter.tsVegaLiteTypes.tsVegaLiteColorAdapter.tsVegaDeclarativeChartHooks.tsuseIsDarkTheme()anduseColorMapping()VegaDeclarativeChartDefault.stories.tsxVegaDeclarativeChart.test.tsxVegaLiteSchemaAdapterUT.test.tsxSupported Chart Types
Key Features
count,sum,mean,min,maxaggregations on bar charts (vertical, horizontal, stacked)transform: [{fold: [...]}]for reshaping wide data to long formatcolorMapref maintains consistent color assignments across re-rendersencoding.y.title(shorthand) andencoding.y.axis.title(explicit)useIsDarkThemehookAPI Surface
Test Plan
tsc --noEmitclean for bothtsconfig.lib.jsonandtsconfig.spec.jsonnx format:checkpassesDeclarativeChart(Plotly adapter) or any other componentpackage.jsonRelated Issue(s)